/*
 * @Author: lili
 * @Description:  社区接口
 */

import axios from './api';


// 帖子列表
export let getList = (page) =>{
    return axios.get(`/api/topic?type=2&page=${page}`);
}

//求职列表
export let getApplyJob = (page) =>{
    return axios.get(`api/apply-job?page=${page}`)
}

// 帖子详情
export let getDetail = (tid) =>{
  return axios.get(`/api/comment?tid=${tid}`);
}

// 评论
export let postComment = (data) =>{
    return axios.post('/api/comment', data);
  }

// 发帖
export let postTopic = (data) =>{
  return axios.post('/api/topic', data);
}

// 点赞
export let addLike = (cid) =>{
  return axios.post('/api/like', cid);
}

// oss上传令牌
export let getOssToken = () =>{
  return axios.get('/api/oss-upload-token');
}

// 抽奖转盘
export let getPrize = (id) =>{
  return axios.get(`/api/lucky-draw/action/${id}`);
}

// 传图
export let uploadPic = (param) =>{
  return axios.post('/api/upload-image', param);
}

